import React,{ Suspense } from 'react';
import {BrowserRouter as Router,Route,Redirect} from 'react-router-dom';
import Header from "~/components/Header/Header"
import './App.scss';
import Routers from "~/route/index.js"
function App() {
  return (
    <div className="App">
      <Router>
           {/* 头部组件 */}
          <Header/>
          <Suspense fallback={<div className="loading">加载中....</div>}>
           <Redirect from="/" to='/home'/>
           <Redirect from="/home" to='/home/tuijian/1'/>
          {Routers.map((route, index) => (
              <Route
                path={route.path}
                key={index}
                component={route.com}
              />
            ))}
          </Suspense>
          
      </Router>
     
    </div>
  );
}

export default App;
